package com.rabbit.vo.req;

import com.rabbit.dto.PageInfoDTO;
import com.rabbit.validate.base.Delete;
import com.rabbit.validate.base.Enable;
import com.rabbit.validate.base.Insert;
import com.rabbit.validate.base.Update;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <h1>角色管理相关请求封装</h1>
 *
 * @author zjw
 * @date 2022/1/18 9:25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RoleReq extends PageInfoDTO {

    /**
     * 角色编号
     */
    @NotNull(message = "角色编号不能为空", groups = {Delete.class, Update.class, Enable.class})
    private Long roleId;

    /**
     * 角色名称
     */
    @NotEmpty(message = "角色名称不能为空", groups = {Insert.class, Update.class})
    private String roleName;

    /**
     * 角色权限字符串
     */
    @NotEmpty(message = "权限字符不能为空", groups = {Insert.class, Update.class})
    private String roleKey;

    /**
     * 角色状态 是否启用（1启用 0禁用）
     */
    @NotNull(message = "角色状态不能为空", groups = {Enable.class})
    private Boolean isEnabled;

    /**
     * 操作人姓名
     */
    private String operatorUserName;

    /**
     * 角色菜单编号
     */
    @NotEmpty(message = "菜单权限不能为空", groups = {Insert.class, Update.class})
    private List<Long> menuIds;
}
